<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" session="false" %>
<%@ page import="com.atozsoft.commonutil.Constants"%>
	
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- 
  - Author(s): houfy
  - Date: 2015-08-01 18:08:45
  - Description:
-->
<head>
	<%@include file="/common.jsp"%>
	<%@include file="/common/common.jsp"%>
	<%@include file="/coframe/tools/skins/common.jsp" %>
	<title>系统消息管理</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
</head>
<body>
	<div class="search-condition">
		<a href="#" class="searchclose"></a>
			<div class="list">
        		<div id="sysMessageForm">
	        	<table class="table" style="width:100%;">
	            	<tr>
	            	    <td class="tit" nowrap style="width:120px">
	              			 发送开始时间：
	      				</td>
		             	<td>
		                	<input class="nui-hidden" name="criteria._expr[1].senddate"/>
                        	<input class="nui-hidden" name="criteria._expr[1]._op" value="between"/>
                        	<input class="nui-datepicker" id="created_min" name="criteria._expr[1]._min" format="yyyy-MM-dd" style="width:100%;"/>
		              	</td>
	              		<td class="tit" nowrap style="width:120px">
	              			发送结束时间：
	              		</td>
	              		<td >
	              			 <input class="nui-datepicker" id="created_max" name="criteria._expr[1]._max" format="yyyy-MM-dd" style="width:100%;"/>
		              	</td>
		              	<td class="tit" style="width:120px">
	              			发送方式：
	      				</td>
		             	<td>
		             	    <input class="nui-dictcombobox nui-form-input" name="criteria._expr[2].sendtype" showNullItem="true" dictTypeId="SYS_MESSAGE_SENDTYPE" showNullItem="true" emptyText="全部" nullItemText="全部" style="width:100%;"/>
                        	<input class="nui-hidden" name="criteria._expr[2]._op" value="="/>
		              	</td>
		              	<td style="width:20px"></td>
	            	</tr>
	            	<tr>
	            	   <td class="tit" style="width:120px">
	              			通知类型：
	              		</td>
	              		<td>
	                		<input class="nui-dictcombobox" name="criteria._expr[3].systemplatetype" dictTypeId="SYS_TEMPLATE_TYPE" showNullItem="true" emptyText="全部" nullItemText="全部" style="width:100%"/>
                	    	<input class="nui-hidden" name="criteria._expr[3]._op" value="="/>
	              		</td>
	              		<td class="tit" style="width:120px">
		              		接收者：
		              	</td>
		              	<td>
		              		<input class="nui-textbox" onEnter='onKeyEnter' name="criteria._expr[4].receivename" style="width:100%"/>
	                		<input class="nui-hidden" name="criteria._expr[4]._op" value="like"/>
	                		<input class="nui-hidden" name="criteria._expr[4]._likeRule" value="all"/>
		              	</td>
		              	<td colspan="3"></td>
		            </tr>
	          	</table>
	          	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="search-btn-area">
				  <tr>
				     <td>
				      	<a class="nui-button" iconCls="icon-search" onclick="search">查询</a>&nbsp;&nbsp;
				      	<a class="nui-button" iconCls="icon-reload" onclick="clear">清空</a>
				     </td>
				  </tr>
	           </table>
	        </div>
	     </div>
	</div>
    <div class="nui-fit">
        <div id="sysMessageGrid" class="nui-datagrid" style="width: 100%; height: 100%;" url="com.atozsoft.commonutil.systemMessage.querySysMessage.biz.ext"
            idfield="messageid" multiselect="true" dataField="sysMessages" sizelist="[10,20,50,100]" pagesize="20">
            <div property="columns">
                <div type="checkcolumn">
                </div>
                <div type="indexcolumn" headerAlign="center" align="center">
                                                      序号
                </div>
		        <div field="title"  headerAlign="center" allowSort="true">
		                               主题
		        </div>
		        <div field="content" width="230px" headerAlign="center" allowSort="true">
		                                内容
		        </div>
		        <div field="senddate" width="80px" headerAlign="center" align="center" allowSort="true">
		                               发送时间
		        </div>
		        <div field="receivename" width="70px" headerAlign="center" align="left" allowSort="true">
		                               接收者
		        </div>
		        <div field="systemplatetype" width="100px" headerAlign="center" align="left" allowSort="true" renderer="itname">
		                              通知类型
		        </div>
		        <div field="sendtype" width="60px" headerAlign="center" allowSort="true" align="center" renderer="itname">
		                               发送方式
		        </div>
            </div>
        </div>
    </div>
	<script>
		// 一览行数据字典显示相关
  		function itname(e)
  		{
        	var dictText="";
        	// 通知类型
        	if (this.field=="systemplatetype"){    
        		dictText = nui.getDictText("<%=Constants.SYS_TEMPLATE_TYPE%>", e.row.systemplatetype);
        		return dictText;
    		}
    		
    		// 发送方式
        	if (this.field=="sendtype"){    
        		dictText = nui.getDictText("<%=Constants.SYS_MESSAGE_SENDTYPE%>", e.row.sendtype);
        		return dictText;
    		}
    	}
	</script>
	<script type="text/javascript">
    	nui.parse();
	    // 初始化系统消息Form
	    var sysMessageForm = new nui.Form("#sysMessageForm");
	    // 初始化列表系统消息控件
	    var sysMessageGrid = nui.get("sysMessageGrid");
	    // 系统消息列表控件加载
	    sysMessageGrid.load();
	    // 系统消息列表默认排序条件
	    sysMessageGrid.sortBy("messageid","desc");
    	
    	// 各种监听事件
	    $(document).ready(
			function(){
			   //收起查询窗口
			   $(".search-condition .searchclose").click(function(){
			  		$(".search-condition .list").toggle();
					setTimeout("nui.layout()", 10 );
			   });
			}
		);
	    
	    //查询
	    function search(){
	        var data = sysMessageForm.getData(true, true);
	        sysMessageGrid.load(data);
	    }
		
		// 清空
		function clear(){
			sysMessageForm.reset();
		}
		
		// 回车执行查询
  		function onKeyEnter(e) {
    		search();
  		}	
    </script>
</body>
</html>